function updateGrid(url, containerId, orderBy) {
    $.ajax({
        url: url,
        data: {
            ContainerId: containerId,
            OrderBy: orderBy
        },
        cache: false,
        success: function (data) {
            $("#" + containerId).html(data);
        },
        error: function (jqXHR, textStatus, errorThrow) {
            alert("Request failed: " + textStatus + ", " + errorThrow);
        }
    });
}
function te006(url) {
    $(".Expand_te001").live("click", function () {
        var expandIcon = $(this);
        var node = expandIcon.parent();
        if(node.hasClass("ExpandLeaf_te003")) {
            return;
        }
        if(node.hasClass("ExpandOpen_te004")) {
            setOpeningClass(node, "ExpandClosed_te005");
        } else {
            if(node.hasClass("ExpandClosed_te005")) {
                if(!node.data("isLoaded_te011")) {
                    loadNodes(url, node, expandIcon, function () {
                    });
                } else {
                    setOpeningClass(node, "ExpandOpen_te004");
                }
            } else {
                throw new Error("invalid opening class");
            }
        }
    });
    $(".Content_te012").live("click", function () {
        selectNode($(this));
    });
}
function selectNode(content) {
    $(".Selected_te016").removeClass("Selected_te016");
    content.addClass("Selected_te016");
}
function setOpeningClass(node, newClass) {
    $.each([
        "ExpandOpen_te004", 
        "ExpandClosed_te005", 
        "ExpandLeaf_te003"
    ], function (index, value) {
        return node.removeClass(value);
    });
    node.addClass(newClass);
}
function loadNodes(url, node, expandIcon, afterSuccess) {
    expandIcon.removeClass("Expand_te001");
    expandIcon.addClass("ExpandLoading_te010");
    $.ajax({
        url: url,
        data: {
            id_te009: node.attr("data-id_te008")
        },
        cache: false,
        success: function (data) {
            node.children("ul").remove();
            node.append(data);
            if(node.children("ul").children().length === 0) {
                setOpeningClass(node, "ExpandLeaf_te003");
            } else {
                setOpeningClass(node, "ExpandOpen_te004");
            }
            node.data("isLoaded_te011", true);
            afterSuccess();
        },
        error: function (jqXHR, textStatus, errorThrow) {
            alert("Request failed: " + textStatus + ", " + errorThrow);
        },
        complete: function () {
            expandIcon.removeClass("ExpandLoading_te010");
            expandIcon.addClass("Expand_te001");
        }
    });
}
function jumpTo_te017(url, nodeIds) {
    loadedTreeWalk(url, nodeIds, 0, null);
}
function loadedTreeWalk(url, nodeIds, index, selectorContext) {
    var node = getNode(nodeIds[index], selectorContext);
    if(index >= nodeIds.length - 1) {
        selectNode(node.children(".Content_te012"));
    } else {
        if(node.data("isLoaded_te011") !== true) {
            loadNodesRecursively(url, nodeIds, index, node);
        } else {
            if(node.hasClass("ExpandClosed_te005")) {
                setOpeningClass(node, "ExpandOpen_te004");
            }
            loadedTreeWalk(url, nodeIds, index + 1, node);
        }
    }
}
function loadNodesRecursively(url, nodeIds, index, node) {
    loadNodes(url, node, node.children(".Expand_te001"), function () {
        var newIndex = index + 1;
        var newNode = getNode(nodeIds[newIndex], node);
        if(newIndex >= nodeIds.length - 1) {
            selectNode(newNode.children(".Content_te012"));
        } else {
            loadNodesRecursively(url, nodeIds, newIndex, newNode);
        }
    });
}
function getNode(id, selectorContext) {
    return $("[data-id_te008='" + id + "']:first", selectorContext);
}
//@ sourceMappingURL=file1.js.map
